package com.example.exceldemo.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;


//@Slf4j
public class DateUtils  {



    public static final String DATETIME_YMD = "yyyy-MM-dd";

    /**
     * 格式化时间
     *
     * @param date
     * @param format
     * @return
     */
    public static String dateformat(String date, String format) {
        SimpleDateFormat sformat = new SimpleDateFormat(format);
        Date dateTmp = null;
        try {
            dateTmp = sformat.parse(date);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return sformat.format(dateTmp);
    }

}